<template>
	<view class="container">
	<!-- 	<view class="top">
			<view class="store-info">
				<view class="store-name">门店:{{store_detail.name}}</view>
				<view class="distance">{{store_detail.distance}}</view>
			</view>
			<view class="other-store" @click="goHere(store_detail.lat,store_detail.lng)">
				导航
			</view>
		</view>
		<view class="em-box"></view> -->
		<!-- 轮播 -->
		<view class="write-box" >
			<image lazy-load="true"  src="../../static/images/goshop3.png" @click="goHere(store_detail.lat,store_detail.lng)" class="write"></image>
		</view>
		<view class="swiper">
			<block v-if="!video_play">
			<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" class="swiper-item">
			<!-- 	<swiper-item>
					<view class="swiper-item">
						<video id="myVideo" objectFit='fill' src="https://dcloud-img.oss-cn-hangzhou.aliyuncs.com/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20181126.mp4"
						                 enable-danmu danmu-btn controls></video>
					</view>
				</swiper-item> -->
				<swiper-item v-for="(item,key) in goods.image" :key="key" >
					<view class="swiper-item">
						<image lazy-load="true"  @click="prev_img(item)" class="swiper-img" mode="aspectFit" :src="item"></image>
					</view>
				</swiper-item>
			</swiper>
			<image src="../../static/images/has_video.png" @click="paly_video" v-if="goods.video" class="has_video"></image>
			</block>
			<view class="banner" v-if="video_play">
				<view class="close_video" @click="close_video">×</view>
				<video v-if="video_play" class="banner-video" :src="goods.video" autoplay="true" controls></video>
			</view>
		</view>
		<view class="item-info">
			<view class="top-ico">
				<image lazy-load="true"  src="../../static/images/top-ico.png" mode="widthFix" class="top-ico"></image>
			</view>
			<view class="part1">
				<view class="sale-info">
					<view class="price-before" v-if="parseFloat(goods.price) > parseFloat(goods.real_price)">￥{{goods.price}}</view>
					<view class="price-now">￥{{goods.real_price}}</view>
					<view class="sold">销量:{{goods.sell_count}}</view>
				</view>
				<view class="follow-share">
					<view class="follow-box" @click="follow_goods(goods.id)">
						<view class="follow"  style="width: 100upx;text-align: center;">
							<image lazy-load="true"  v-show="!goods.is_follow" src="../../static/images/follow-ico.png" class="follow" mode="widthFix"></image>
							<image lazy-load="true"  v-show="goods.is_follow" src="../../static/images/fllow.png" class="follow" mode="widthFix"></image>
						</view>
						<view class="text" style="width: 100upx;text-align: center;"><block v-if="goods.is_follow">已</block>收藏</view>
					</view>
				<!-- 	<view class="share-box" @click="goShareBox">
						<view class="share">
							<image lazy-load="true"  src="../../static/images/share-ico.png" class="share" mode="widthFix"></image>
						</view>
						<view class="text">分享</view>
					</view> -->
				</view>
			</view>
			<view class="part2">
				<view class="title">{{goods.name}}</view>
				<view class="info">{{goods.description}}</view>
			</view>
			<view class="part3">
				<view class="item">
					<view class="title">选择规格</view>
					<view class="info type-list">
						<view class="spec" @click="setChecked(item.store_sku_id)" v-for="(item,key) in goods.spec_list" :key="key" v-if="key<2" :class="{'active':item.checked == true,'active1':item.store_sku_id == store_sku_id}">{{item.spec}}</view>
						<view class="spec" @click="setChecked(item.store_sku_id)" v-for="(item,key) in goods.spec_list" :key="key" v-if="show_more_list && key>1" :class="{'active':item.checked == true,'active1':item.store_sku_id == store_sku_id}">{{item.spec}}</view>
					</view>
					<view class="show-more" v-if="goods.spec_list.length>2" @click="setShowMoreSpec">
						<image lazy-load="true"  src="../../static/images/show-more.png" class="show-more" mode="widthFix"></image>
					</view>
				</view>
				<view class="item">
					<view class="title">购买数量</view>
					<view class="amount">
						<view class="reduce" @click="cutNum">-</view>
						<view class="num">{{goods_num}}</view>
						<view class="plus" @click="addNum">+</view>
					</view>
				</view>
				<view class="item">
					<view class="title">配送方式</view>
					<view class="info">物流配送</view>
				</view>
				<view class="item" v-if="goods.brand.is_del==0">
					<view class="title">品牌</view>
					<view class="info">{{goods.brand.name}}</view>
				</view>
				<view class="item" @click="showDetail">
					<view class="title">商品参数</view>
					<view class="info">{{goods.spec_detail[0].key}}:{{goods.spec_detail[0].value}}</view>
					<view class="show-more">
						<image lazy-load="true"  src="../../static/images/show-more.png" class="show-more" mode="widthFix"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="bgf">
			<view class="part4">
				<view class="left">
					<view class="img"><image lazy-load="true"  :src="goods.store.logo" mode="aspectFit" class="img"></image></view>
				</view>
				<view class="right">
					<view class="item item1">
						<view class="title">{{goods.store.name}}</view>
						<view class="go-in" @click="goHome(goods.store.id)">进店</view>
					</view>
					<view class="item item2">地址：{{goods.store.province}}{{goods.store.city}}{{goods.store.area}}{{goods.store.address}}</view>
					<view class="item item3" @click="goCall">电话：{{goods.store.tel}}</view>
				</view>
			</view>
		</view>
		<view class="bgf">
			<view class="view-box">
				<view class="name">ta们说</view>
				<view class="msg" v-if="note_lists.length==0">
					暂无评价
				</view>
				<view class="msg"  style="color:#859dc2;" v-if="note_lists.length>0" @click="goGoodsNotes">
					查看全部 >> 
				</view>
			</view>
			<view class="author" v-if="note_lists.length>0">
				<view class="author-info">
					<view class="ico"><image lazy-load="true"  :src="note_lists[0].user.base_avatar" class="ico"></image></view>
					<view class="name">{{note_lists[0].user.base_nickname}}</view>
				</view>
				<view class="title">{{note_lists[0].content}}</view>
			</view>
		</view>
		<view class="bgf">
			<view class="center">
				商品详情
			</view>
		</view>
		<view class="content">
			<!-- <view class="content-tap">
				<view class="item item1" @click="setTabNum(1)" :class="{'active':tabNum == 1}">详情</view>
				<view class="item item2" @click="setTabNum(2)" :class="{'active':tabNum == 2}">商品参数</view>
				<view class="item item3" @click="setTabNum(3)" :class="{'active':tabNum == 3}">ta们说</view>
			</view> -->
			<!-- 详情 -->
			
			<view class="goods-img" v-if="tabNum == 1">
				<view class="img" style="font-size: 0;">
					<image lazy-load="true"  v-for="(item , key) in goods.detail" :key="key" class="img" :src="item" mode="widthFix"></image>	
				</view>
			</view>
			<view class="empty"></view>
			<!-- 规格 -->
			<view class="type" v-if="tabNum == 2">
				<view class="type-info">
					<view class="item" v-for="(item,key) in goods.spec_detail" :key="key">
						<view class="title">{{item.key}}</view>
						<view class="info">{{item.value}}</view>
					</view>
				</view>
			</view>
			<!-- 买家说 -->
			<view class="buyer-say" v-if="tabNum == 3">
				<view class="article-list" >
					<view class="article" v-for="(item,key) in note_lists" @click="goShare(item.id)" :key="key">
						<view class="article-img">
							<image lazy-load="true"  :src="item.thumbnail[0]" class="article-img"></image>
						</view>
						<view class="title">{{item.title}}</view>
						<view class="author">
							<view class="author-info">
								<view class="ico"><image lazy-load="true"  :src="item.user.base_avatar" class="ico"></image></view>
								<view class="name">{{item.user.base_nickname}}</view>
							</view>
							<!-- <view class="share">
								<view class="text">现金200+</view>
								<view class="share-ico">
									<image lazy-load="true"  src="../../static/images/article-share-ico.png" class="share-ico"></image>
								</view>
							</view> -->
						</view>
						<view class="info">
							<view class="good"><view>点赞</view><view class="good-num">{{item.like_count}}</view></view>
							<view class="discuss"><view>评论</view><view class="discuss-num">{{item.comment_count}}</view></view>
							<view class="see"><view>浏览</view><view class="see-num">{{item.scan_count}}</view></view>						
						</view>	
					</view>
						
				</view>
			</view>
		</view>
		<!-- 选择规格弹窗 -->
		<!-- <uni-popup ref="popup" type="bottom" :maskClick="true" class="local-store-popup">
			<view class="popup-box">
				<view class="type-select">
					<view class="type-part1">
						<view class="img">
							<image lazy-load="true"  :src="goods.thumbnail" class="img"></image>
						</view>
						<view class="price-stock">
							<view class="price">￥{{goods.real_price}}</view>
						</view>
						<view class="close-btn" @click="closePopup()">
							<image lazy-load="true"  src="../../static/images/close-btn.png" class="close-btn"></image>
						</view>
					</view>
					<view class="type-part2">
						<view class="title">规格</view>
						<scroll-view scroll-y="true" class="scroll_box">
							<view class="type-list">
								<view class="item" @click="setChecked(item.store_sku_id)" v-for="(item,key) in goods.spec_list" :key="key" :class="{'active':item.checked == true,'active1':item.store_sku_id == store_sku_id}">{{item.spec}}</view>
							</view>
						</scroll-view>
					</view>
					<view class="type-part3">
						<view class="title">购买数量</view>
						<view class="amount">
							<view class="reduce" @click="cutNum">-</view>
							<view class="num">{{goods_num}}</view>
							<view class="plus" @click="addNum">+</view>
						</view>
					</view>
				</view>
				<view class="confirm" @click="goNextPopup()">立即购买</view>
			</view>
		</uni-popup> -->
		<view class="empty"></view>
		<view class="menu">
			<view class="ico-box">
				<view class="row-box row-box1" @click="goHome(goods.store.id)">
					<image lazy-load="true"  src="../../static/images/home-new.png" class="zhuye"></image>
				</view>
				<view class="row-box">
					
					<!-- #ifdef MP-WEIXIN -->
					<image lazy-load="true"  src="../../static/images/sever-new.png" class="kefu2"></image>
					<button class="kefu-btn" open-type="contact"></button>
					<!-- #endif -->
					<!-- #ifdef H5 -->
					<image lazy-load="true"  src="../../static/images/sever-new.png" class="kefu2"></image>
					<button class="kefu-btn" @click="goTel"></button>
					<!-- #endif -->
				</view>
			</view>
			<view class="btn-box-buy">
				<view class="share-earn-money" @click="goShareBox">推广得</view>
				<view class="buy" @click="goNextPopup">立即购买</view>
			</view>
		</view>
		<view class="share-all-box" style="display: none;">
			<view class="share-bg-box">
				<image lazy-load="true"  src="../../static/images/share-bg-img.png" mode="widthFix" class="share-bg"></image>
				<image lazy-load="true"  src="../../static/images/close-2.png" class="close-2" @click="hideShareBox"></image>
				<view class="qrcode-box">
					<image lazy-load="true"  :src="qrcode_url_new" class="qrcode"></image>
					<view class="share-pop-tit">
						<text>面对面</text>
						<text class="mrgin-r">看单品</text>
					</view>
					<view class="share-text share-text-box">
						好友成单
					</view>
					<view class="share-text">
						即可获得奖励
					</view>
					<view class="shear-btn-box">
						<button open-type="share" class="share-btn-1">
							<image lazy-load="true"  src="../../static/images/share-friend.png" class="share-friend"></image>
						</button>
						<image lazy-load="true"  src="../../static/images/card.png" class="card" @click="goCard"></image>
					</view>
					<view class="smll-size">
						可获得元宝
					</view>
				</view>
			</view>
		</view>
		<view class="share-h5-box" @click="hide_share_box" v-if="share_h5_box == 1">
			<image src="../../static/images/share5.png" class="share-h5-img"></image>
		</view>
		<tki-qrcode
		style="position: absolute;z-index: -1;top:-2000upx;left: -1000upx;"
		   ref="qrcode"
		   cid="qrcode1"
			lv= 1
		   :val="qrcode_url"
		   @result="qrR" />
		   <min-action-sheet ref="as1">
		       <view><button @click="click_share" style="padding: 20upx 0;font-size: 28upx;background-color: #FFFFFF;border: none;border-bottom: none;border-top: none;" open-type="share">转发</button></view>
		   </min-action-sheet>
		   <min-action-sheet ref="as">
		       <view class="type">
		       	<view class="type-info">
		       		<view class="item" v-for="(item,key) in goods.spec_detail" :key="key">
		       			<view class="title">{{item.key}}</view>
		       			<view class="info">{{item.value}}</view>
		       		</view>
		       	</view>
		       </view>
			   <view class="over-btn" @click="hideDetail">完成</view>
		   </min-action-sheet>
	</view>
</template>

<script>
	import minActionSheet from '@/components/min-action-sheet/min-action-sheet'
	import tkiQrcode from "@/components/tki-qrcode/tki-qrcode.vue"
	export default {
		data() {
			return {
				"tabNum":1,
				"isActive":false,
				"showNum_bak":1,
				"showShareBox":0,
				'qrcode_url':"",
				'qrcode_url_new':"",
				'store_sku_id':"",
				'goods_type':"",
				'goods':{},
				'goods_num':1,
				"latitude":0,
				"longitude":0,
				"store_detail":{},
				"user_obj":{},
				"p":1,
				share_h5_box:0,
				"per":10,
				note_lists:[],
				is_bottom:false,
				stauts_code:0,
				video_play: false,
				show_more_list:false
			}
		},
		onLoad(e){
			var self = this;
			// uni.setStorageSync('share_id',e.share);
			this.store_sku_id = e.id;
			this.showNum_bak = e.id;
			self.user_obj = uni.getStorageSync('user');	
		},
		onShow() {
			var self = this;
			self.$request.request({
				url:'/user/info',
				success:function(res){
					self.stauts_code = res.code
					if(res.code == 200){
						let user_id_s = res.result.id;
						let share_id = uni.getStorageSync('share_id') ? uni.getStorageSync('share_id') : 0;
						if(user_id_s && share_id){
							self.$request.request({
								url:'/user/set_bind',
								data:{
									send_user_id:share_id,
									receive_user_id:user_id_s
								},
								success:function(res){
									
								}
							});
						}
					}
				}
			});
			// #ifdef MP-WEIXIN
			self.qrcode_url =  self.$request.share_url+'?page=goods&id='+self.store_sku_id+'&share='+(self.user_obj?self.user_obj.id:0);
			// #endif
			
			this.getGoodsData();
			this.note_list();
			this.share_h5_box=0;
			
			
		},
		onShareAppMessage(res) {
			   var self = this;
		   if (res.from === 'button') {// 来自页面内分享按钮
		     console.log(res.target)
		   }
		   return {
		     title:self.goods.name ,
				imageUrl:self.goods.image[0],
		     path: '/pages/local-store-item/local-store-item?id='+self.store_sku_id+'&share='+(self.user_obj?self.user_obj.id:0)
		   }
		 },
		 
		components: {tkiQrcode,minActionSheet},
		methods: {
			showDetail(){
				this.$refs.as.handleShow({
					showCancel:false
				  })
			},
			hideDetail(){
				this.$refs.as.handleHide()
			},
			paly_video(){
				this.video_play = true;
			},
			close_video(){
				this.video_play = false;
			},
			setTabNum(num){
				this.tabNum = num;
			},
			setShowMoreSpec(){
				this.show_more_list = !this.show_more_list
			},
			onReachBottom(){
				if(this.tabNum==3){
					if(this.is_bottom) return;
					this.is_bottom = true;
					this.p++;
					this.note_list();
				}	
			},
			note_list(){
				var self=this;
				this.$request.request({
					url:'/note/search',
					data:{
						store_sku_id:this.store_sku_id,
						p:this.p,
						per:this.per
					},
					success:function(res){
						
						if(res.code==200){
							var x = res.result;
							for(var i=0;i<x.length;i++){
								x[i].thumbnail.forEach((item,index)=>{
									x[i].thumbnail[index] =self.$http_img(item);
								});
							}
							self.note_lists =self.note_lists.concat(x);
							this.is_bottom = false;
						}else{
							
						}
					}
				})
			},
			goGoodsNotes(){
				uni.navigateTo({
				    url: '../all-goods-notes/all-goods-notes?id='+this.store_sku_id,
				});
			},
			goTel(){
				uni.makePhoneCall({
				    phoneNumber: '13684076389'
				});
			},
			openPopup(){
				this.$refs.popup.open()
			},
			closePopup(){
				this.$refs.popup.close()
				
			},
			goNextPopup(){
				uni.navigateTo({
				    url: '../shopping-cart/shopping-cart?id='+this.store_sku_id+'&num='+this.goods_num
				});
			},
			setChecked(brandId){
				var self = this;
				var listArr = this.goods.spec_list;
				for(var i = 0;i<listArr.length;i++){
					if(listArr[i].store_sku_id == brandId){
						if(!listArr[i].checked){
							listArr[i].checked = true;
							self.store_sku_id = brandId;
							self.goods_type=listArr[i].spec;
							self.getGoodsData()
						}
					}else{
						listArr[i].checked = false;
					}
				}
			},
			goShare(id){
				uni.navigateTo({
				    url: '../share-details/share-details?id='+id
				});
			},
			hide_share_box(){
				this.share_h5_box = 0;
			},
			goShareBox(){
				if(this.stauts_code == 40003){
					uni.navigateTo({
						url:'../login/login?page=local-store-item&id='+this.store_sku_id
					})
				}else{
					// this.$refs.qrcode._makeCode();
					
					this.$refs.as1.handleShow({
						actions: [
						  {
							name: '生成海报',
							color: '#000000',
							loading: 0
						  }
						],
						success: (res) => {
						  switch (res.id) {
							// -1代表取消按钮
							case -1:
							  
							  break
							// 代表异步按钮
							case 0:
							  res.handleHide();
							  this.$request.request({
							  	url:'/share/goods',
							  	data:{
							  		store_sku_id:this.store_sku_id,
							  	},
							  	success:function(res){
							  		
							  	}
							  });
							  this.goCard();
							  break
						  }
						}
					  })
					
				}
			},
			click_share(){
	
				this.$refs.as1.handleHide();
				// #ifdef H5
				this.share_h5_box = 1;
				// #endif
				// #ifdef MP-WEIXIN
				this.$request.request({
					url:'/share/goods',
					data:{
						store_sku_id:this.store_sku_id,
					},
					success:function(res){
						
					}
				});
				// #endif
			},
			qrR(e){
				console.log(e)
				this.qrcode_url_new = e;
				this.showShareBox = 1;
			},
			hideShareBox(){
				this.showShareBox=0
			},
			goCard(){
				// #ifdef MP-WEIXIN
				uni.navigateTo({
					url: '../canvas/canvas?url='+encodeURIComponent(this.qrcode_url)+'&base_avatar='+encodeURIComponent(this.goods.store.logo)+'&base_nickname='+encodeURIComponent(this.goods.store.name)+'&title='+encodeURIComponent(this.goods.name)+'&content='+encodeURIComponent(this.goods.description)+'&img_url='+encodeURIComponent(this.goods.image[0])
				});
				// #endif
				
				// #ifdef H5
				console.log('h5')
				uni.navigateTo({
					url: '../canvas_h5/canvas_h5?url='+encodeURIComponent(this.qrcode_url)+'&base_avatar='+encodeURIComponent(this.goods.store.logo)+'&base_nickname='+encodeURIComponent(this.goods.store.name)+'&title='+encodeURIComponent(this.goods.name)+'&content='+encodeURIComponent(this.goods.description)+'&img_url='+encodeURIComponent(this.goods.image[0])
				});
				// #endif
			},
			goHome(id){
				uni.switchTab({
				    url: '/pages/index/index'
				});
			},
			goCall(){
				uni.makePhoneCall({
				    phoneNumber: this.goods.store.tel //仅为示例
				});
			},
			goHere(lat,lng){
				var self = this;
				// #ifdef MP-WEIXIN
				uni.openLocation({
				    latitude: parseFloat(lat),
				    longitude: parseFloat(lng),
				    success: function () {
				        console.log('success');
				    }
				}); 
				// #endif
							
				// #ifdef H5
				self.wx.openLocation({
				  latitude: parseFloat(lat), // 纬度，浮点数，范围为90 ~ -90
				  longitude: parseFloat(lng), // 经度，浮点数，范围为180 ~ -180。
				  name: '', // 位置名
				  address: '', // 地址详情说明
				  scale: 13, // 地图缩放级别,整形值,范围从1~28。默认为最大
				  infoUrl: '' // 在查看位置界面底部显示的超链接,可点击跳转
				});	
				// #endif       
			},
			prev_img(url){
				var self = this;
				// #ifdef MP-WEIXIN
				uni.previewImage({
				    urls:self.goods.image,
					current:url,
				    longPressActions: {
				        itemList: ['发送给朋友', '保存图片', '收藏'],
				        success: function(data) {
				            console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
				        },
				        fail: function(err) {
				            console.log(err.errMsg);
				        }
				    }        
				});
				// #endif
							
				// #ifdef H5
				self.wx.previewImage({
				  current: url, // 当前显示图片的http链接
				  urls: self.goods.image // 需要预览的图片http链接列表
				});
				// #endif   
			},
			getStore(){
				var self = this;
				uni.getLocation({
				    type: 'wgs84',
				    success: function (res) {
						console.log(res)
						self.latitude = res.latitude;
						self.longitude = res.longitude;
						self.getStoreDetail();
						
				    },
					fail() {
						self.latitude = 30.657420;
						self.longitude = 104.065840;
						self.getStoreDetail();
					}
				});
			},
			getStoreDetail(){
				var self = this;
				this.$request.request({
					url:'/store/info',
					data:{
						store_id:this.goods.store.id,
						lng:this.longitude,
						lat:this.latitude
					},
					success:function(res){
						if(res.code==200){
							var x = res.result;
							x.distance=parseInt(x.distance)>1000 ? parseFloat(parseInt(x.distance/100)/10)+'km' : parseInt(x.distance)+'m'
							self.store_detail = x;
							
						}else{
							
						}
					}
				})
			},
			follow_goods(id){
				var self = this;
				if(self.goods.is_follow){
					this.$request.request({
						url:'/goods/unfollow',
						data:{
							store_sku_id:id
						},
						success:function(res){
							if(res.code==200){
								uni.showToast({
									title:"取消成功~",
									icon:'none',
									duration:2000
								})
								self.goods.is_follow = false
							}else if(res.code==40003){
								uni.navigateTo({
									url:'../login/login?page=local-store-item&id='+this.store_sku_id
								})
							}
						}
					})
				}else{
					this.$request.request({
						url:'/goods/follow',
						data:{
							store_sku_id:id
						},
						success:function(res){
							if(res.code==200){
								uni.showToast({
									title:"收藏成功~",
									icon:'none',
									duration:2000
								});
								self.goods.is_follow = true
							}else if(res.code==40003){
								uni.navigateTo({
									url:'../login/login?page=local-store-item&id='+this.store_sku_id
								})
							}
						}
					})
				}
			},
			getGoodsData(){
				var self = this;
				this.$request.request({
					url:'/goods/detail',
					data:{
						store_sku_id:this.store_sku_id
					},
					success:function(res){
						if(res.code==200){
							var x = res.result;
							x.detail = JSON.parse(x.detail);
							x.image = JSON.parse(x.image);
							x.detail.forEach((item,index)=>{
								x.detail[index] =self.$http_img(item);
							});
							x.spec_list.forEach((item,index)=>{
								x.spec_list[index].checked =false;
							});
							x.image.forEach((item,index)=>{
								x.image[index] =self.$http_img(item);
							});
							x.spec_detail = JSON.parse(x.spec_detail);
							x.thumbnail =self.$http_img(x.thumbnail);
							if(x.video){
								x.video =self.$http_img(x.video);
							}
							x.price =self.$money(x.price);
							x.real_price =self.$money(x.real_price);
							x.store.logo =self.$http_img(x.store.logo);
							self.goods = x;
							self.goods_type=x.spec;
							self.getStore();
							// #ifdef H5
							self.qrcode_url =  self.$request.h5_share_url+'?page=local-store-item&share='+(self.user_obj ? self.user_obj.id : 0)+'&id='+self.store_sku_id;
							let share_time_line={
								title:x.name, // 分享标题
								link: self.$request.h5_share_url+'?page=local-store-item&share='+(self.user_obj ? self.user_obj.id : 0)+'&id='+self.store_sku_id, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
								imgUrl: self.$request.h5_img_url+'/static/images/logo.png', // 分享图标
							}
							let share_app_message={
								title: x.name, // 分享标题
								desc:'这个商品很适合你，来看看吧！', // 分享描述
								link: self.$request.h5_share_url+'?page=local-store-item&share='+(self.user_obj ? self.user_obj.id : 0)+'&id='+self.store_sku_id, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
								imgUrl: self.$request.h5_img_url+'/static/images/logo.png', // 分享图标
							}
							uni.setStorageSync('share_time_line',share_time_line);
							uni.setStorageSync('share_app_message',share_app_message);
							self.$request.wx_config()
							
							// #endif
							
							console.log('----------------------')
							console.log(x)
						}else{
							
						}
					}
				})
			},
			addNum(){
				this.goods_num++
			},
			cutNum(){
				if(this.goods_num>1){
					this.goods_num--
				}
			}
		}
	}
</script>

<style>
	@import url("local-store-item.css");
</style>
